package com.glsc.ngateway.common.base.domain.mysql.gateway.other;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;
import java.util.Objects;

/**
 * @author zhouzp
 * @date 2020/5/29
 * 产品干系人，如总负责人、投资经办、市场经理、市场经办、承揽人，以及部门信息如承揽部门、规模归属部门、收入归属部门
 */
@Data
@ToString(callSuper = true)
@Entity
@Table(name = "t_am_product_relation_log")
public class ProductRelationLog extends BaseProductRelation {

    private static final long serialVersionUID = -8975791096213392172L;

    @ApiModelProperty(value = "关联关系日志表id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "log_id")
    private Integer logId;

    @ApiModelProperty(value = "关联关系表id")
    @Column(name = "relation_id")
    private Integer relationId;

    @ApiModelProperty(value = "主表log的主键，log_id")
    @Column(name = "ref_log_id", columnDefinition = "INT(11) NULL COMMENT '主表log的主键，log_id'")
    private Integer refLogId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ProductRelationLog)) return false;
        ProductRelationLog that = (ProductRelationLog) o;

        return Objects.equals(this.getLogId(), that.getLogId())
                &&Objects.equals(this.getRelationId(), that.getRelationId())
                &&Objects.equals(this.getProdId(), that.getProdId())
                && Objects.equals(this.getRefLogId(), that.getRefLogId())
                && Objects.equals(this.getRelationType(), that.getRelationType())
                && Objects.equals(this.getRelatedId(), that.getRelatedId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getLogId(),getRelationId(), getProdId(),getRefLogId(),getRelatedId(),getRelationType());
    }

    public Integer getLogId() {
        return logId;
    }

    public void setLogId(Integer logId) {
        this.logId = logId;
    }

    public Integer getRelationId() {
        return relationId;
    }

    public void setRelationId(Integer relationId) {
        this.relationId = relationId;
    }

    public Integer getRefLogId() {
        return refLogId;
    }

    public void setRefLogId(Integer refLogId) {
        this.refLogId = refLogId;
    }


}


